<template>
  <div class="app-container book">
    <div class="content">
      <div class="block" v-for="(item,index) in list" :key="index" v-if="list" @click="goToInfo(item)">
        <div class="item">
          <img class="item-cover" :src="newspaperUrl+item.fileName.substr(0,4)+'.jpg'" alt="">
          <span class="name">{{item.paperName}}</span>
          <span class="time">{{item.fileName.substr(4,8)}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import baseUrl from "@/api/base";
export default {
  props:["list"],
  data() {
    return {
      currentPage: 1
    };
  },
  created(){
    this.newspaperUrl = baseUrl.newspaperUrl;
  },
  components: {},
  methods: {
    goToInfo(item) {
      this.$router.push("/newspaper/info?max_file_name="+item.cover+"&resourceType=4&value="+item.paperName);
    },
  }
};
</script>
<style lang="less" scoped>
.book {
  padding: 0px 20px 20px 20px;
  border-radius: 10px;
  background: #fff;
  .content {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 30px;
    .block {
      width: 226px;
      margin-top: 20px;
      padding-bottom: 24px;
      border-bottom: 1px solid #eaeaea;
      margin-bottom: -1px;
      cursor: pointer;
      .item {
        display: flex;
        flex-direction: column;
        .item-cover {
          width: 226px;
          height: 86px;
        }
          .name {
            font-size: 18px;
            margin-top: 20px;
          }
          .time {
            font-size: 14px;
            color: #a1a1a1;
            margin-top: 10px;
          }
      }
    }
    .block:not(:nth-child(4n + 1)) {
      padding-left: 85px;
    }
  }
}
</style>


